#version 330 core
layout (location = 0) in vec3 aPos;  // 顶点位置
layout (location = 1) in vec2 aTexCoord;  // 顶点纹理坐标
layout (location = 2) in vec3 aNormal; // 法线方向
layout (location = 3) in float aAoIntensity; // 环境光遮蔽强度
layout (location = 4) in float aSmoothness; // 光滑度

out vec2 TexCoord;  // 输出颜色
out vec3 Normal; // 输出法线
out float AoIntensity; // 输出环境光遮蔽强度
out float Smoothness;// 输出光滑度

out vec3 FragPos;
//out vec4 FragPosLightSpace;
//uniform mat4 lightSpaceMatrix;

uniform mat4 model;  // 模型矩阵
uniform mat4 view;  // 视图矩阵
uniform mat4 projection;  // 投影矩阵


void main()
{
    TexCoord = aTexCoord;  // 传递纹理坐标
    Normal = aNormal; // 传递法线方向
    AoIntensity = aAoIntensity; // 传递环境光遮蔽强度
    Smoothness = aSmoothness; // 输出光滑度

    FragPos = vec3(model * vec4(aPos, 1.0));
    //FragPosLightSpace = lightSpaceMatrix * vec4(FragPos, 1.0);

    gl_Position = projection * view * vec4(FragPos, 1.0);
    //gl_Position = projection * view * model * vec4(aPos, 1.0);  // 计算顶点位置

}